using System;
using System.Collections.Generic;
using System.Windows.Forms;
using wow_backtiupCore;
using LocaleHundler;

namespace wow_backtiup
{
    static class Program
    {
       internal  static TheDarkOwlLogger.TheDarkOwlLogger Bugger = new TheDarkOwlLogger.TheDarkOwlLogger(false, true, true,Application.ProductName);
        
        
        [STAThread]
        static void Main()
        {
            LocaleHundlerCore locale = new LocaleHundlerCore();
            locale.Translate();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmGui());
        }

        /// <summary>
        /// The bug reporting method
        /// </summary>
        /// <param name="e">exception to be reported</param>
        public static void Bugtracking(Exception e)
        {
            //ScrablerCore core = new ScrablerCore();
            Exception test = new Exception("System.NullReferenceException: Object reference not set to an instance of an object.\nat Scrabler.ScrablerCore.Eval(String sCSCode, String scriptname, String NameSapce, String Clas, String func, String[] refs, WareForm winGUI)");
            //   DataException;

            if ((e.ToString().Equals("System.NullReferenceException: Object reference not set to an instance of an object.\n at Scrabler.ScrablerCore.Eval(String sCSCode, String scriptname, String NameSapce, String Clas, String func, String[] refs, WareForm winGUI)") == false) && (e.Message != test.Message) && (e.ToString() != test.ToString()))
            {
                Bugger.TakeTheException2XmlLog(e, Application.ProductName, Kernel.GetVersion());

                //MessageBox.Show(e.Message );
            }

            else
            {

                Bugger.TakeTheException2XmlLog(e, Application.ProductName, Kernel.GetVersion());
            }

        }
    }
}